$menu-item-padding:15px 0;

@-moz-document url-prefix() {
  .left-menubox-list {
    padding-bottom: 60px !important;
  }
}

#app {

  .slide-modal-box {
    display: none;
    position: fixed;
    left: $sideBarWidth;
    right: 0;
    top: 55px;
    bottom: 0;
    z-index: 10;
    background-color: rgba(0, 0, 0, .3);

    &.show {
      display: block;
    }
  }

  .hideSidebar {
    .nest-menu-popup {
      left: 54px !important;

      .nest-menu-popup {
        left: $sideBarChildWidth+54 !important;

        .nest-menu-popup {
          left: $sideBarChildWidth +54 + $sideBarChildWidth +54 !important;
        }
      }
    }
  }

  .main-container {
    min-height: 100%;
    transition: margin-left .28s;
    margin-left: $sideBarWidth;
    position: relative;
  }

  .sidebar-container {
    transition: width 0.28s;
    width: $sideBarWidth !important;
    background-color: $menuBg;
    height: 100%;
    position: fixed;
    font-size: 0px;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    // overflow: hidden;

    .el-submenu__icon-arrow {
      color: $colorC;
      margin-top: -5px;
    }
    .el-submenu__title {
      height: 50px !important;
      line-height: 50px !important;
    }
    .el-menu-item {
      height: 40px !important;
      line-height: 40px !important;
    }
    .el-submenu{
      border-bottom: 1px solid #F7F7F7;
    }
    // 菜单列表样式
    .left-main-menubox {
      font-size: 12px;
      color: $colorA;

      .svg-icon {
        color: $colorB;
      }

      .left-menubox-list {
        margin: 0;
        padding: 0;
        padding-bottom: 25px;

        .item {
          position: relative;
          // height: 30px;
          // line-height: 20px;
          // padding: 16px 0;
          white-space: nowrap;
          cursor: pointer;
          transition: background-color .3s linear;
          border-bottom: 1px solid rgba(247, 247, 247, 1);
          box-sizing: border-box;

          // display: flex;
          // align-items: center;
          // color:$menuItemText;
          height: 50px;

          a {
            padding: $menu-item-padding;
            display: inline-block;
            height: inherit;
            box-sizing: border-box;
            line-height: 20px;
          }

          .menu-favorites-icon {
            display: none;
            position: absolute;
            right: 10px;
            top: 15px;
            color: #FFC400 !important;
            font-size: 14px !important;

            &.on {
              color: #FFC400 !important;
            }
          }

          &:hover {
            background-color: $menuHover;
            color: $menuHoverText;

            .menu-favorites-icon {
              display: block;
            }

            .el-submenu__icon-arrow,
            .svg-icon {
              color: $qup-color-primary;
            }
          }

          .submenu-title-noDropdown {
            padding: 0 20px !important;

            &.on {
              background-color: $menuHover;
              color: $menuHoverText;
              transition: background-color .3s linear;
            }
          }

          .nest-menu {
            position: absolute;
            padding: $menu-item-padding;
            padding-left: 20px;
            padding-right: 20px;
            
            // flex: 1 0 auto;
            // top: 50%;
            // transform: translateY(-50%);
            width: 100%;
            height: inherit;
            &>span{
              line-height: 20px;
            }


            .nest-menu .nest-menu-popup.show .menu-favorites-icon {
              display: none;
            }

            .nest-menu .nest-menu-popup.show .item:hover .menu-favorites-icon {
              display: block;
            }
          }

          .nest-menu-popup {
            display: none;
            position: fixed;
            left: $sideBarWidth;
            top: 55px;
            bottom: 0;
            // width: $sideBarChildWidth !important;
            width: $sideBarWidth !important;
            z-index: 50;
            border-radius: 0;
            box-shadow: -1px 0px 0px #f2f2f2;
            // overflow-y: auto;
            background-color: $menuBg;

            .nest-menu-title {
              display: none;
            }

            .item {
              color: $colorA;

              &:hover {
                color: $qup-color-primary;

                .menu-favorites-icon {
                  display: block;
                }
              }

              .submenu-title-popup {
                padding: 0 20px;

                &.on {
                  background-color: $menuHover;
                  color: $menuHoverText;
                  transition: background-color .3s linear;
                }
              }
            }

            .menu-favorites-icon {
              display: none;
              right: 20px;
              color: #FFC400;
            }

            // 第三级弹出菜单
            .nest-menu-popup {
              left: $sideBarWidth + $sideBarChildWidth;
              width: $sideBarChildWidth !important;

              // 第四级弹出菜单(一行两列样式)
              .nest-menu-popup {
                left: $sideBarWidth+$sideBarChildWidth+$sideBarChildWidth;
                // width: $sideBarLastWidth !important; // 一行两列的宽度
                width: $sideBarChildWidth !important; // 一行一列额宽度
                // background-color: #BEBEBE !important;
                // bottom: auto;
                padding-bottom: 30px;

                .nest-menu-title {
                  display: block;
                  font-size: 12px;
                  font-weight: 600;
                  margin: 0 10px;
                  box-shadow: 0px 1px 0px #eee;
                  padding: 10px 0;
                  color: $colorA !important;
                  clear: both;
                }

                /* .item{
                  float: left;
                  width: 170px;
                  margin-top: 5px;
                  margin-bottom: 5px;

                  &:hover{
                    .menu-favorites-icon{
                      display: block;
                    }
                  }

                  &:nth-of-type(even){
                    margin-right: 10px;
                  }

                  .submenu-title-popup{
                    padding: 0 10px;
                  }
                } */

                .menu-favorites-icon {
                  display: none;
                  right: 10px;
                }
              }
            }

            &::-webkit-scrollbar-track-piece {
              background: rgba(144, 147, 153, 0.15);
            }

            &::-webkit-scrollbar {
              width: 6px;
            }

            &::-webkit-scrollbar-thumb {
              background: rgba(144, 147, 153, 0.3);
              border-radius: 20px;
            }
          }

          .nest-menu-popup.show {
            display: block;
          }
        }

        // 菜单项激活
        .active-item {
          background-color: rgba(84,221,184,0.1);
          color: $menuActiveItemText;
          &::before {
            content: "";
            display: inline-block;
            width: 3px;
            height: 30px;
            background: linear-gradient(360deg, rgba(54, 204, 192, 1) 0%, rgba(84, 221, 184, 1) 100%);
            position: absolute;
            height: 60%;
            top: 50%;
            transform: translateY(-50%);
          }
        }
      }
    }

    // 菜单列表样式

    .el-menu-item,
    .el-submenu__title {
      height: 35px;
      line-height: 35px;
    }

    .menu-wrapper {
      position: relative;
      margin: 15px 0;

      .menu-favorites-icon {
        display: none;
        position: absolute;
        right: 10px;
        top: 11px;
        color: #fff;
        font-size: 13px !important;

        &.on {
          color: #FFC400;
        }
      }
    }

    //菜单弹出样式修改
    .popup-out-menu .el-menu--inline {
      position: fixed;
      left: $sideBarWidth;
      top: 55px;
      bottom: 0;
      width: $sideBarChildWidth !important;
      z-index: 10;
      border-radius: 0;
      box-shadow: -1px 0px 0px #D8D8D8;
      overflow-y: auto;

      .el-menu--inline {
        //最后一级菜单样式
        left: $sideBarWidth+$sideBarChildWidth;
        width: $sideBarLastWidth !important;
        box-shadow: none;
        background-color: #BEBEBE !important;

        .el-menu-item,
        .menu-wrapper.nest-menu .el-submenu__title {
          background-color: #BEBEBE !important;

          &:hover {
            background-color: $subMenuHover !important;
          }
        }

        .menu-wrapper {
          float: left;
          margin: 0;

          &:nth-of-type(even) .el-menu-item {
            margin-left: 10px;
          }

          .el-menu-item {
            width: 170px !important;
            min-width: 170px !important;
          }
        }
      }

      .el-menu-item {
        position: relative;
        padding: 0 20px !important;
        height: 35px !important;
        line-height: 35px !important;
      }

      .menu-wrapper.nest-menu {

        .el-submenu__title {
          padding: 0 20px !important;
          height: 35px !important;
          line-height: 35px !important;
        }
      }

      &::-webkit-scrollbar-track-piece {
        background: #777D7B;
      }

      &::-webkit-scrollbar {
        width: 6px;
      }

      &::-webkit-scrollbar-thumb {
        background: #888888;
        border-radius: 20px;
      }
    }

    .popup-out-menu .el-menu--inline.collapse-transition {
      transition: height;
    }

    .menu-top-title {
      font-size: 14px;
      padding-left: 18px;
      cursor: pointer;
      height: 50px;
      line-height: 50px;
      background: #fff;
      color: $menuText;
      border-bottom: 1px solid #f6f6f6;
      font-weight: 600;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      color: #333;

      //cc
      display: flex;
      justify-content: space-between;
      align-items: center;

      &.center {
        text-align: center;
        padding-left: 0;

        .menu-top-title-icon {
          margin-right: 0;
        }
      }

      .menu-top-title-icon {
        font-size: 22px;
        vertical-align: -6px;
        margin-right: 5px;
      }
    }

    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
      padding-bottom: 33px;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0px;
      visibility: hidden;
    }

    .el-scrollbar {
      height: 100%;
    }

    &.has-logo {
      .el-scrollbar {
        height: calc(100% - 50px);

        @media screen and (-ms-high-contrast: active),
        (-ms-high-contrast: none) {
          overflow: visible;
          -ms-overflow-style: none;
          box-sizing: border-box;
          padding-right: 15px;
        }
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }

    .svg-icon {
      margin-right: 10px;
    }

    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
    }

    .el-menu-item {
      font-size: 12px;
    }

    .el-submenu__title {
      font-size: 12px;
    }

    // menu hover
    .submenu-title-noDropdown,
    .el-submenu__title {
      &:hover {
        color: $menuHoverText !important;
      }

      i {
        color: #fff;
      }
    }

    .is-active>.el-submenu__title {
      color: $subMenuActiveText !important;
    }

    & .nest-menu .el-submenu>.el-submenu__title,
    & .el-submenu .el-menu-item {
      min-width: $sideBarWidth !important;
      // background-color: $subMenuBg !important;
      background-color: $subMenuBg;

      &:hover {
        background-color: $subMenuHover !important;
        color: $subMenuHoverText !important;
      }
    }
  }

  .hideSidebar {
    .sidebar-container {
      width: 54px !important;
    }

    .main-container {
      margin-left: 54px;
    }

    .svg-icon {
      margin-right: 0px;
    }

    .submenu-title-noDropdown {
      padding: 0 !important;
      position: relative;

      .el-tooltip {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }
      }
    }

    .el-submenu {
      overflow: hidden;

      &>.el-submenu__title {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }

        .el-submenu__icon-arrow {
          display: none;
        }
      }
    }

    .el-menu--collapse {
      .el-submenu {
        &>.el-submenu__title {
          &>span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
        }
      }
    }
  }

  .el-menu--collapse .el-menu .el-submenu {
    min-width: $sideBarWidth !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }

    .sidebar-container {
      transition: transform .28s;
      width: $sideBarWidth !important;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$sideBarWidth, 0, 0);
      }
    }
  }

  .withoutAnimation {

    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
  &>.el-menu {
    .svg-icon {
      margin-right: 16px;
    }
  }

  .nest-menu .el-submenu>.el-submenu__title,
  .el-menu-item {
    &:hover {
      // you can use $subMenuHover
      background-color: $menuHover !important;
    }
  }

  // the scroll bar appears when the subMenu is too long
  >.el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #777D7B;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #888888;
      border-radius: 20px;
    }
  }
}
